﻿using STHPMS1.DAL.D_Core;
using STHPMS1.ICore.I_DAL.Repository;
using STHPMS1.ICore.I_Entity.Stmpms1;
using System.Collections.Generic;
using System.Data;
using ServiceStack.OrmLite;

namespace STHPMS1.DAL.D_Repository
{
    public class Dr_Stru_MateRepository : DalBase, IDr_Stru_MateRepository
    {
        public IEnumerable<T> GetMaterialByType<T>(string stru_type) where T : class, IDr_Stru_Mate
        {
            string sql = string.Format(@"select * from DR_STRU_MATE where STRU_TYPE in( {0} ) ORDER by STRU_TYPE,LAYER_DICTID,CAST (STRU_ID as int);", stru_type);
            IDbConnection conn = Adapter.OpenDbConnection();
            return conn.Select<T>(sql);
        }

    }
}
